home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGNG_C
/
SCRN11.LZH
/
DEMO.C
next >
Wrap
Text File
|
1987-06-30
|
8KB
|
236 lines
/*****************************************************************************/
/* */
/* DEMO FOR SCRNLIB release 1 */
/* */
/* */
/*****************************************************************************/
#include "scrnlib.h"
char scn1[4002];
char scn2[450];
main()
{
int i, jkl;
char a,x;
/* page 1 */
setattr(0,9); /* blinking black on blue */
cls(); /* clear screen */
gotoxy(25,10); /* put cursor near middle of screen */
cursoff(); /* turn off cursor */
printsh("WELCOME TO THE SCRNLIB DEMO"); /* print opening */
beep();
gotoxy(25,24); /* place cursor on bottom of screen */
setattr(1,7); /* blue,white */
printsh("hit any key to continue ...");
keywait(); /* wait for user input */
/* page 2 */
setattr(4,7); /*red on white*/
cls();
gotoxy(12,3);
printsh("SCRNLIB HAS WHAT YOU NEED FOR SCREEN MANIPULATION !!");
gotoxy(1,8);
printsh("SCRNLIB was developed for the person who needs the power to");
printsh(" control all aspects \n of a text screen including the ability");
printsh(" to do windowing.");
gotoxy(25,24);
printsh(" hit any key to continue ...");
keywait();
/* page 3 */
cls();
setattr(1,7);
gotoxy(5,2);
printsh("This demo contains a series of screen manipulations to illustrate\n");
printsh("the powers of the SCRNLIB routines. There are numerous pauses throughout\n");
printsh("these procedures to allow you to observe each new screen output. Each\n");
printsh("requires only a single stroke of any key to move on.\n\n");
printsh(" So, just rest your fingers on the spacebar, or any other of your favorite\n");
printsh("keys, sit back and enjoy the ride.");
gotoxy(20,24);
printsh("p.s. This is one of those pauses.");
keywait();
/* page 4 */
setattr(0,7);/*for the monochromes.So they don't underline the entire screen*/
cls();
setattr(6,3); /* brown,cyne */
gotoxy(3,10);
printsh("MOST SCRNLIB FUNCTIONS WERE WRITTEN IN ASSEMBLY FOR SPEED AND EFFICIENCY");
gotoxy(21,15);
keywait();
printsh("THE FUNCTIONS LET YOU BE CREATIVE!");
keywait();
/* page 5 */
setattr(2,7); /*green on white*/
cls();
setattr(11,0);
i=2;
for (jkl=2;jkl<23;jkl++,i+=3){
gotoxy(i,jkl);
printsh("cursor positioning");
} /* end for */
setattr(2,7); /* green,white */
i=2;
for (jkl=2;jkl<23;jkl++,i+=3){
gotoxy(i,jkl);
printsv("cursor positioning");
} /* end for */
gotoxy(55,8);
printsh("... with color !!");
scrnsavd(scn1,0,0,79,24);
keywait();
/* page 6 */
cls();
setattr(13,0); /* magenta,green */
gotoxy(28,10);
printsh("SAVE SCREENS EASILY");
keywait();
/*return of page 5 */
scrnrstd(scn1,0,0);
setattr(1,15);
gotoxy(35,5);
printsh("AND RESTORE THEM EASILY TOO!");
gotoxy(25,22);
printsh("remember this screen ?");
scrnsavd(scn1,0,0,79,24);
keywait();
/* page 7 */
setattr(7,0); /* light blue,red */
cls();
gotoxy(35,1);
printsh("WINDOWING");
keywait();
setattr(7,0);
window(10,10,34,19,2); /* open a window and put a double border around it*/
gotoxy(14,12);
cls();
gotoxy(14,11);
printsh("USE WINDOWS");
keywait();
gotoxy(14,14);
printsh("ENHANSED WITH");
keywait();
gotoxy(14,16);
setattr(9,0);
printsh("COLOR!!");
keywait();
cls();
gotoxy(15,15);
printsh("SCROLLING");
keywait();
gotoxy(18,15);
printmcv("u",5);
gotoxy(19,15);
printmcv("p",5);
keywait();
scrlup(5);
keywait();
gotoxy(14,15);
printsh("or SCROLL DOWN");
keywait();
scrldn(4);
keywait();
window(0,0,79,24,0);
gotoxy(12,8);
printsh("or even SCROLL IT ALL ");
setattr(7,0);
keywait();
scrldn(4);
keywait();
window(36,7,76,23,0);
gotoxy(36,7);
setattr(9,0);
printsh("Windows can be created to allow screen output to the windowed area only.");
printsh(" The window on the left was activated and the border drawn with one simple command:\n\n");
printsh("\twindow(10,10,20,20,2);\n\n");
printsh("Now you are in an editor created with thecommands:\n do {\n");
printsh(" a=getkey();\n putsch(&a);\n } while (a != 'X');\n");
printsh("Putsch knows when to return to the next line and when to scroll up.");
setattr(14,0);
printsh("\nType in it for a while. Then, just type a capital 'X' to get out.");
scrnsavd(scn2,9,9,22,22);
setattr(5,0);
window(10,10,20,20,2); /* open window for editor */
setattr(13,4);
cls();
curson();
do {
a=getkey();
putsch(&a);
} while (a != 'X');
cursoff();
window(0,0,79,24,0); /* set active window to the entire screen*/
setattr(9,0);
printsh("The area under the screen was stored previously with the scrnsavd command:\n");
printsh("\tscrnsavd(scn2,9,9,22,22);\n");
printsh("it can easily be restored with the scrnrstd command:\n");
printsh("\tscrnrstd(scn2,9,9);");
keywait();
scrnrstd(scn2,9,9);
keywait();
printsh("\n\nDon't forget, we can restore entire screens also!");
keywait();
/* again, the return of page 5 */
scrnrstd(scn1,0,0);
keywait();
/* page 8 */
setattr(5,0);
cls();
window(1,1,78,23,1);/*window the entire screen except for the outer edge*/
/*and put a border around it*/
gotoxy(28,7);
printsh("SCRNLIB also gives you -");
setattr(4,2);
gotoxy(16,10);
printsh(" P R I N T I N G F L E X I B I L I T Y ");
keywait();
/* page 9 */
setattr(7,0); /*So the screen is not all underlined on monochromes*/
cls();
setattr(1,0);
gotoxy(16,12);
printsh(" P R I N T I N G F L E X I B I L I T Y ");
gotoxy(16,5);
setattr(1,7);
printsh(" P R I N T T E X T H O R I Z O N T A L L Y ");
setattr(1,0);
keywait();
setattr(4,0);
gotoxy(4,4);
printsv("or print vertically");
gotoxy(71,4);
printsv("or print vertically");
setattr(2,0);
gotoxy(15,23);
printsh("One command for each purpose to make it EASY!!!");
keywait();
/* 10th and final page */
cls();
gotoxy(30,2);
printsh("Dave Millis");
gotoxy(30,3);
printsh("P.O. Box 2371");
gotoxy(30,4);
printsh("Glenview, Illinois 60025");
setattr(9,0);
gotoxy(1,10);
printsh("SCRNLIB is an easy solution to the problems of controlling text ");
printsh("on the\n\nscreen. This package enables you to write code");
printsh(" which is not only efficient \n\nbut also very creative. ");
printsh("TRY OUT SCRNLIB and if you find it helpful, just \n\nsend me $10 ");
printsh("to become a registered user.");
keywait();
gotoxy(78,23);
curson();
}